<template>
	<view class="content" style="width: 95%;margin: 0 auto;">
		<u-cell-group title="帐号绑定:">
				<u-cell icon="account-fill" title="用户名称" :value="baseInfo.name"></u-cell>
				<u-cell icon="account-fill" title="手机绑定" :value="baseInfo.phone"></u-cell>
				<!-- <u-cell icon="email-fill" title="邮箱绑定" :value="baseInfo.email"></u-cell> -->
		</u-cell-group>
		
		<!-- <u-cell-group title="密码:">
				<u-cell icon="lock-fill" title="登陆密码" value="修改" @click="modifypassword"></u-cell>
		</u-cell-group> -->
		<view class="btn">
			<u-button @click="showModal=true" type="primary">
				  	退出登陆
			</u-button>
		</view>
		
		<u-modal :show="showModal" showCancelButton title="退出登录" content='确定要退出吗?' @cancel="showModal=false" @confirm="confirmExit"></u-modal>
	</view>
</template>
<script>
import {toast, clearStorageSync, setStorageSync, getStorageSync, useRouter} from '@/utils/utils.js'
export default {
	data() {
		return {
			baseInfo: {
			  name:'',
			  phone:'',
			  avatar:'',
			  email : '',
			  company_name:'',
			  registerDate:'',
			  login_code:'',
			  auth: 0,
			},
			version:"",
			showModal: false,
		}
	},
	onLoad(op) {
		//this.id  = op.id
	},
	onShow() {
		this.baseInfo.name = getApp().globalData.userName
		this.baseInfo.phone = getApp().globalData.repairPhone
	},
	onReady() {
		const that = this
		uni.getSystemInfo({
			success: function (res) {
				console.log("res", res)
				that.version = res.appVersion
			}
		})
	},
	methods: {
		confirmExit() {
			uni.removeStorageSync('token')
			this.showModal =false
			useRouter('/pages/public/login',{} ,'reLaunch')
		},
		
		modifypassword(){
			useRouter('/pagesTwo/account/password',{} ,'navigateTo')
		},
		email(){
			useRouter('/pagesTwo/account/email',{} ,'navigateTo')
		},
		phone(){
			useRouter('/pagesTwo/account/phone',{} ,'navigateTo')
		},
	}
}
</script>
<style lang="scss" scoped>	
   page{background:#f2f2f2}
	 .content{
		 height: 100vh;
		 .btn {
			 margin: 100rpx auto;
			 width:94%
		 }
	 }
	@media (min-width: 768px) {
		::v-deep .u-button--primary{
			padding: 30rpx !important;
			font-size: 22rpx !important;
		}
		::v-deep .u-cell-group__title__text {
			font-size: 22rpx !important;
		}
		::v-deep .u-cell__value {
			font-size: 22rpx !important;
		}
		::v-deep .u-cell__title-text {
			font-size: 22rpx !important;
		}
		::v-deep .u-icon__icon{
			font-size: 24rpx !important;
		}
		::v-deep .u-cell__body {
			padding: 15px !important;
		}
	}
</style>
